package com.example.pets.model.entities;



import androidx.room.ColumnInfo;
import androidx.room.Entity;
import androidx.room.Ignore;
import androidx.room.PrimaryKey;

import java.util.ArrayList;
import java.util.Date;
import java.util.List;
import androidx.room.Entity;
import androidx.room.PrimaryKey;
import androidx.room.TypeConverters;

import com.example.pets.model.entities.dao.ListConverter;

import java.util.List;

@Entity(tableName = "posts")
public class Post {

    @PrimaryKey(autoGenerate = true)
    private int postId; // 动态唯一标识符
    private String authorId; // 发布者的uid
    private String authorurl; // 发布者的头像
    private String authorname; // 发布者的昵称
    private String content; // 动态文字内容
    private String title; // 动态文字内容
    @ColumnInfo(name = "image_urls")
    @TypeConverters(ListConverter.class)
    private List<String> imageUrls; // 动态图片URL数组

    private int likesCount; // 点赞数量
    private int commentsCount; // 评论数量

    private double Latitude;  //经度
    private double Longitude;//纬度

    private String adress;  //地址信息
    private boolean islost;  //地址信息


    public String getTitle() {
        return title;
    }

    public void setTitle(String title) {
        this.title = title;
    }

    public boolean isIslost() {
        return islost;
    }

    public void setIslost(boolean islost) {
        this.islost = islost;
    }

    public double getLatitude() {
        return Latitude;
    }

    public void setLatitude(double latitude) {
        Latitude = latitude;
    }

    public double getLongitude() {
        return Longitude;
    }

    public void setLongitude(double longitude) {
        Longitude = longitude;
    }

    public String getAdress() {
        return adress;
    }

    public void setAdress(String adress) {
        this.adress = adress;
    }

    public String getAuthorname() {
        return authorname;
    }

    public void setAuthorname(String authorname) {
        this.authorname = authorname;
    }

    public String getAuthorurl() {
        return authorurl;
    }

    public void setAuthorurl(String authorurl) {
        this.authorurl = authorurl;
    }

    public int getPostId() {
        return postId;
    }

    public void setPostId(int postId) {
        this.postId = postId;
    }

    public String getAuthorId() {
        return authorId;
    }

    public void setAuthorId(String authorId) {
        this.authorId = authorId;
    }

    public String getContent() {
        return content;
    }

    public void setContent(String content) {
        this.content = content;
    }

    public List<String> getImageUrls() {
        return imageUrls;
    }

    public void setImageUrls(List<String> imageUrls) {
        this.imageUrls = imageUrls;
    }



    public int getLikesCount() {
        return likesCount;
    }

    public void setLikesCount(int likesCount) {
        this.likesCount = likesCount;
    }

    public int getCommentsCount() {
        return commentsCount;
    }

    public void setCommentsCount(int commentsCount) {
        this.commentsCount = commentsCount;
    }
    @Ignore
    public Post() {
    }

    public Post(int postId, String authorId, String content, List<String> imageUrls, int likesCount, int commentsCount,boolean islost) {
        this.postId = postId;
        this.authorId = authorId;
        this.content = content;
        this.imageUrls = imageUrls;
        this.likesCount = likesCount;
        this.commentsCount = commentsCount;
        this.islost=islost;
    }


    // Getters and Setters...
}

